import request from '@/utils/request'

// 查询文件讨论-用户和文件列表
export function listDiscussUsersFiles(query) {
  return request({
    url: '/discussComments/discussUsersFiles/list',
    method: 'get',
    params: query
  })
}

// 查询文件讨论-用户和文件详细
export function getDiscussUsersFiles(id) {
  return request({
    url: '/discussComments/discussUsersFiles/' + id,
    method: 'get'
  })
}

// 根据ID查询附件和参与人
export function getAttachUserIdById(id) {
  return request({
    url: '/discussComments/discussUsersFiles/getAttachUserIdById/' + id,
    method: 'get'
  })
}

// 添加评论人
export function addCommenter(query) {
  return request({
    url: '/discussComments/discussUsersFiles/addCommenter',
    method: 'get',
    params: query
  })
}

// 剔除评论人
export function delCommenter(query) {
  return request({
    url: '/discussComments/discussUsersFiles/delCommenter',
    method: 'get',
    params: query
  })
}

// 保存文件讨论-用户和文件
export function saveDiscussUsersFiles(data) {
  return request({
    url: '/discussComments/discussUsersFiles/save',
    method: 'post',
    data: data
  })
}

// 删除文件讨论-用户和文件
export function delDiscussUsersFiles(id) {
  return request({
    url: '/discussComments/discussUsersFiles/' + id,
    method: 'delete'
  })
}

// 例如: 文档库点讨论. 如果改文件未加入讨论. 新建一个(目前文档库讨论按钮已全部放开)
export function newDiscussionNotification(fileId) {
  return request({
    url: '/discussComments/discussUsersFiles/newDiscussionNotification/' + fileId,
    method: 'get'
  })
}

